<!DOCTYPE html>

<head>
    <meta charset="UTF-8" />
    <title>Element Plus demo</title>

</head>
<body>

<link rel="stylesheet" href="../plugins/elementui/index.css">

<div id="app-6" style="width: 200px">
    <el-form >
        <el-input v-model="tel"></el-input>
        <el-input v-model="pwd" show-password></el-input>
        <el-button @click="login" type="primary" round>登录</el-button>
        <el-button type="warning" round>注册</el-button>
    </el-form>
</div>

<script src="../js/vue.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<script src="../js/vue-router.js"></script>
<script>
    var app6 = new Vue({
        router:new VueRouter(),
        el: '#app-6',
        data:{
            tel:"",
            pwd:""
        },
        methods:{
            login(){
                axios.get("/login/"+this.tel+"/"+this.pwd).then((res)=>{
                    if(res.data.flag){
                        this.$router.push('main.html');
                    }else{
                        this.$message.error("账号或密码错误");
                    }
                })
            }
        }
    })
</script>
</body>
</html>

